import 'package:json_annotation/json_annotation.dart';

part 'activity_detail_bean.g.dart';


@JsonSerializable()
class ActivityDetailBean extends Object {

  @JsonKey(name: 'address')
  String address;

  @JsonKey(name: 'aim')
  String aim;

  @JsonKey(name: 'checked')
  int checked;

  @JsonKey(name: 'collectnum')
  int collectnum;

  @JsonKey(name: 'company_id')
  int companyId;

  @JsonKey(name: 'cost')
  String cost;

  @JsonKey(name: 'cost_type')
  int costType;

  @JsonKey(name: 'create_time')
  int createTime;

  @JsonKey(name: 'deadline')
  int deadline;

  @JsonKey(name: 'description')
  String description;

  @JsonKey(name: 'end_time')
  int endTime;

  @JsonKey(name: 'form')
  int form;

  @JsonKey(name: 'group_id')
  int groupId;

  @JsonKey(name: 'has_checkquestion')
  int hasCheckquestion;

  @JsonKey(name: 'has_coursefile')
  int hasCoursefile;

  @JsonKey(name: 'id')
  int id;

  @JsonKey(name: 'is_online')
  int isOnline;

  @JsonKey(name: 'join_member_num')
  int joinMemberNum;

  @JsonKey(name: 'join_members')
  List<Join_members> joinMembers;

  @JsonKey(name: 'likenum')
  int likenum;

  @JsonKey(name: 'limit_people')
  int limitPeople;

  @JsonKey(name: 'location')
  String location;

  @JsonKey(name: 'logo')
  String logo;

  @JsonKey(name: 'looknum')
  int looknum;

  @JsonKey(name: 'needcheck')
  int needcheck;

  @JsonKey(name: 'notify_config')
  String notifyConfig;

  @JsonKey(name: 'small_group_id')
  int smallGroupId;

  @JsonKey(name: 'start_time')
  int startTime;

  @JsonKey(name: 'status')
  int status;

  @JsonKey(name: 'type')
  int type;

  @JsonKey(name: 'update_time')
  int updateTime;

  @JsonKey(name: 'user_id')
  int userId;

  @JsonKey(name: 'is_apply')
  bool isApply;

  @JsonKey(name: 'is_joined')
  bool isJoined;

  @JsonKey(name: 'is_like')
  bool isLiked = false;


  ActivityDetailBean(
      this.address,
      this.aim,
      this.checked,
      this.collectnum,
      this.companyId,
      this.cost,
      this.costType,
      this.createTime,
      this.deadline,
      this.description,
      this.endTime,
      this.form,
      this.groupId,
      this.hasCheckquestion,
      this.hasCoursefile,
      this.id,
      this.isOnline,
      this.joinMemberNum,
      this.joinMembers,
      this.likenum,
      this.limitPeople,
      this.location,
      this.logo,
      this.looknum,
      this.needcheck,
      this.notifyConfig,
      this.smallGroupId,
      this.startTime,
      this.status,
      this.type,
      this.updateTime,
      this.userId,
      this.isApply,
      this.isJoined);

  factory ActivityDetailBean.fromJson(Map<String, dynamic> srcJson) => _$ActivityDetailBeanFromJson(srcJson);

  Map<String, dynamic> toJson() => _$ActivityDetailBeanToJson(this);

}


@JsonSerializable()
class Join_members extends Object {

  @JsonKey(name: 'activity_id')
  int activityId;

  @JsonKey(name: 'create_time')
  int createTime;

  @JsonKey(name: 'deleted')
  int deleted;

  @JsonKey(name: 'id')
  int id;

  @JsonKey(name: 'status')
  int status;

  @JsonKey(name: 'update_time')
  int updateTime;

  @JsonKey(name: 'user_id')
  int userId;

  @JsonKey(name: 'user_logo')
  String userLogo;

  @JsonKey(name: 'user_name')
  String userName;


  Join_members(this.activityId, this.createTime, this.deleted, this.id,
      this.status, this.updateTime, this.userId, this.userLogo, this.userName);

  factory Join_members.fromJson(Map<String, dynamic> srcJson) => _$Join_membersFromJson(srcJson);

  Map<String, dynamic> toJson() => _$Join_membersToJson(this);

}


